/*
 * Copyright (c) 2020 Carnegie Lee
 * All rights reserved
 */
package com.geekc.threadpool.pool;

import com.geekc.threadpool.pool.impl.DefaultThreadPool;

/**
 * Thread Pool Factory默认实现类
 * @author Carnegie Lee
 */
public class DefaultThreadPoolFactory {

    /** 线程池 */
    private volatile static ThreadPool threadPool = null;

    private DefaultThreadPoolFactory() {}

    public static ThreadPool getInstance() {
        if (null == threadPool) {
            synchronized (DefaultThreadPoolFactory.class) {
                if (null == threadPool) {
                    threadPool = new DefaultThreadPool();
                }
            }
        }
        return threadPool;
    }


}
